﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace HYWJ.jxgl
{
    public partial class ZYGLForm : Office2007Form
    {
        public ZYGLForm()
        {
            InitializeComponent();
        }

        private void ZYGLForm_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text==""||textBox1.Text==null)
            {
                MessageBox.Show("请输入成绩");
            }
            else
            {
                MessageBox.Show("成绩提交成功");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("该方案成功转换为历史案例！");
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode.Text.ToString()=="辅助评估成绩")
            {
                richTextBox1.Text = "学员1的辅助评估成绩为80";
            }
            else if (treeView1.SelectedNode.Text.ToString()=="情况分析")
            {
                open(Application.StartupPath + @"\提交文档\情况分析\1.txt");
            }
            else if (treeView1.SelectedNode.Text.ToString() == "决心制定")
            {
                open(Application.StartupPath + @"\提交文档\决心制定\1.txt");
            }
            else if (treeView1.SelectedNode.Text.ToString() == "结果评估")
            {
                open(Application.StartupPath + @"\提交文档\结果评估\1.txt");
            }
        }
        private void open(string file)
        {
            System.IO.StreamReader reader = new System.IO.StreamReader(file, System.Text.Encoding.Default);
            string content = reader.ReadToEnd();
            richTextBox1.Text = content;
            reader.Dispose();
        }
    }
}
